//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: TimeStampInvalidException.cs
//
//  Description: Thrown if the time stamp is not valid.
// 
//--------------------------------------------------------------------------

using System;
using System.Runtime.Serialization;

namespace Chili.Opf3.Concurrency.TimeStamp
{
	/// <summary>
	/// Exception is thrown if the type of the persistent's member holding the time stamp is not valid.
	/// </summary>
	/// <remarks>
	/// This exception is thrown if the type of the persistent's member holding the time stamp is not valid.
	/// Currently only string is supported as valid type for the field holding the <see cref="TimeStampAttribute">TimeStampAttribute</see>.
	/// All other types are not supported and throw this exception.
	/// </remarks>
	[Serializable]
	public sealed class TimeStampTypeInvalidException : Exception
	{
		/// <summary>
		/// Creates a new instance of the <see cref="TimeStampNotFoundException">TimeStampNotFoundException Class</see>.
		/// </summary>
		private TimeStampTypeInvalidException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		/// <summary>
		/// Creates a new instance of the <see cref="TimeStampNotFoundException">TimeStampNotFoundException Class</see>.
		/// </summary>
		public TimeStampTypeInvalidException()
		{
		}

		/// <summary>
		/// Creates a new instance of the <see cref="TimeStampNotFoundException">TimeStampNotFoundException Class</see>.
		/// </summary>
		/// <param name="message">A message that describes the current exception.</param>
		public TimeStampTypeInvalidException(string message)
			: base(message)
		{
		}

		/// <summary>
		/// Creates a new instance of the <see cref="TimeStampNotFoundException">TimeStampNotFoundException Class</see>.
		/// </summary>
		/// <param name="message">A message that describes the current exception.</param>
		/// <param name="inner">The exception that caused the current exception.</param>
		public TimeStampTypeInvalidException(string message, Exception inner)
			: base(message, inner)
		{
		}
	}
}
